﻿using System.Collections.Generic;
using System.Linq;
using GNSCore.Helpers;
using GNSCore.Managers;
using GNSCore.Model;
using GNSCore.Repositories;

namespace GNSCore.Managers
{
    /// <summary>
    /// For managing locales
    /// </summary>
    public class LocaleManager
    {
        private IRepository<Model.Locale> _localeRep;

        //private IRepository<Model.GeoExtensionData> _localeRep;
        //private IRepository<Model.GeoData> _localeRep;
        
        /// <summary>
        /// Default constructor for creating object graph
        /// </summary>
        public LocaleManager()
        {
        }

        /// <summary>
        /// Constr with concrete repository implementation paramenter
        /// </summary>
        /// <param name="_rep"></param>
        public LocaleManager(IRepository<Locale> _rep)
        {
            _localeRep = _rep;
        }

        /// <summary>
        /// Return list of all locales
        /// </summary>
        /// <returns>List of all locales</returns>
        public List<Locale> GetLocales()
        {
            return _localeRep.GetAll<Locale>().ToList();
        }
    }
}